/**************************************************************************//**
 * @file    AttributeHelper.h
 * @author  İsmail SEZEN (email: sezenismail@gmail.com)
 * @date    02-08-2009
 *
 * <b>Description</b>
 *
 * This is header file of AttributeHelper.c\n
 *
 * Copyright (C) 2009 İsmail SEZEN
 *
 * <b>License</b>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *****************************************************************************/

/** Macros *///{
#define GET_ATT_P(type,ncid,varid,attName) ((type*)get_att_p(ncid,varid,attName))
#define GET_ATT(type,ncid,varid,attName)/**/ \
{ \
	type* r = NULL; \
	if( (r= GET_ATT_P(type,ncid,varid,attName) ) == NULL ) exit(EXIT_FAILURE); \
	return *r; \
} \
//}

extern void* get_att_p(int ncid, int varid, const char* attName);

extern char* get_string_att_p(int ncid,int varid,const char* attName);
extern float* get_float_att_p(int ncid,int varid,const char* attName);
extern double* get_double_att_p(int ncid, int varid,const char* attName);
extern short* get_short_att_p(int ncid, int varid,const char* attName);
extern int* get_int_att_p(int ncid, int varid,const char* attName);

extern float get_float_att(int ncid,int varid, const char* attName);
extern short get_short_att(int ncid,int varid, const char* attName);
extern int get_int_att(int ncid,int varid, const char* attName);
extern double get_double_att(int ncid,int varid, const char* attName);
